/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ui;

import javax.swing.JDialog;

/**
 *
 * @author Esteban
 */
public class PanelDetalleBloqueHorarioProfesor extends javax.swing.JPanel {

    /**
     * Creates new form PanelDetalleBloqueHorarioProfesor
     */
    public PanelDetalleBloqueHorarioProfesor(CeldaHorarioProfesor info, JDialog superPanel) {
        initComponents();
        mostrarInfo(info);
        this.superPanel=superPanel;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        detalle = new javax.swing.JLabel();
        horario = new javax.swing.JLabel();
        modalidad = new javax.swing.JLabel();
        estudiantes = new javax.swing.JLabel();
        estudiante1 = new javax.swing.JLabel();
        estudiante2 = new javax.swing.JLabel();
        btnCerrar = new javax.swing.JButton();
        curso = new javax.swing.JLabel();
        profesor = new javax.swing.JLabel();

        detalle.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
        detalle.setForeground(new java.awt.Color(51, 153, 255));
        detalle.setText("Detalle de Clase Seleccionada del Profesor: ");

        horario.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        horario.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        horario.setText("Horario: ");

        modalidad.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        modalidad.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        modalidad.setText("Modalidad:");

        estudiantes.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        estudiantes.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        estudiantes.setText("Estudiantes: ");

        estudiante1.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        estudiante1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        estudiante1.setText("Estudiantes 1:  ");

        estudiante2.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        estudiante2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        estudiante2.setText("Estudiantes 2:  ");

        btnCerrar.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        btnCerrar.setText("Cerrar");
        btnCerrar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnCerrarMouseClicked(evt);
            }
        });
        btnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarActionPerformed(evt);
            }
        });

        curso.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        curso.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        curso.setText("Curso:");

        profesor.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
        profesor.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        profesor.setText("Profesor");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(estudiantes, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(estudiante1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(modalidad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(horario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(estudiante2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(curso, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 558, Short.MAX_VALUE)
                    .addComponent(profesor, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 558, Short.MAX_VALUE))
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(147, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(253, 253, 253))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(detalle)
                        .addGap(145, 145, 145))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(detalle)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(profesor)
                .addGap(20, 20, 20)
                .addComponent(curso)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(horario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(modalidad)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(estudiantes)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(estudiante1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(estudiante2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
                .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnCerrarActionPerformed

    private void btnCerrarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCerrarMouseClicked
        // TODO add your handling code here:
        cerrarPanel();
    }//GEN-LAST:event_btnCerrarMouseClicked

    private void cerrarPanel(){
        superPanel.setVisible(false);
        superPanel.dispose();
        superPanel=null;
    }    
    
    private void mostrarInfo(CeldaHorarioProfesor info){
        profesor.setText(info.getProfesor());
        curso.setText("Curso: "+info.getCurso());
        horario.setText("Horario: "+info.getDia()+" "+info.getHoraInicio()+"-"+info.getHoraFin());
        modalidad.setText("Modalidad: "+info.getModalidad());
        estudiante1.setText(info.getEstudiante1());
        estudiante2.setText(info.getEstudiante2());
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCerrar;
    private javax.swing.JLabel curso;
    private javax.swing.JLabel detalle;
    private javax.swing.JLabel estudiante1;
    private javax.swing.JLabel estudiante2;
    private javax.swing.JLabel estudiantes;
    private javax.swing.JLabel horario;
    private javax.swing.JLabel modalidad;
    private javax.swing.JLabel profesor;
    // End of variables declaration//GEN-END:variables
    private JDialog superPanel;
}
